package com.sfh.sfhshopweb.enums;

import com.baomidou.mybatisplus.annotation.EnumValue;

public enum BooleanEnums {
    TRUE(1, true),
    FALSE(0, false);

    @EnumValue
    private Integer code;
    private Boolean desc;

    BooleanEnums(Integer code, Boolean desc) {
        this.code = code;
        this.desc = desc;
    }

    public static BooleanEnums getEnumByCode(Integer code) {
        for (BooleanEnums booleanEnum : BooleanEnums.values()) {
            if (booleanEnum.getCode().equals(code)) {
                return booleanEnum;
            }
        }
        return null;
    }

    public Integer getCode() {
        return code;
    }

    public Boolean getDesc() {
        return desc;
    }
}
